
#include "xsg_sp_util.hpp"

int change_qos_para(const std::string& data)
{
	if (data.compare("routine") == 0) return 0;
	else if (data.compare("priority") == 0) return 1;
	else if (data.compare("immediate") == 0) return 2;
	else if (data.compare("flash") == 0) return 3;
	else if (data.compare("flash_overriden") == 0) return 4;
	else if (data.compare("critic_ecp") == 0) return 5; 
	else if (data.compare("internetwork_ctrl") == 0) return 6;
	else if (data.compare("network_ctrl") == 0) return 7;
	return -1;
}

int change_qos_nh(const std::string& data)
{
	if (data.compare("normal") == 0) return 0;
	else if (data.compare("high") == 0) return 1;
	return -1;
}

int change_qos_nm(const std::string& data)
{
	if (data.compare("normal") == 0) return 0;
	else if (data.compare("minimize") == 0) return 1;
	return -1;
}

int change_qos_nl(const std::string& data)
{
	if (data.compare("normal") == 0) return 0;
	else if (data.compare("low") == 0) return 1;
	return -1;
}

int change_slk_action(const std::string& data)
{
	if (data.compare("act") == 0) return 0;
	else if (data.compare("inact") == 0) return 1;
	else if (data.compare("inh") == 0) return 2;
	else if (data.compare("uninh") == 0) return 3;
	else if (data.compare("test") == 0) return 4;
	return -1;
}

int change_uat_type(const std::string& data)
{
	if (data.compare("iua") == 0) return 1;
	else if (data.compare("m3ua") == 0) return 3;
	else if (data.compare("sua") == 0) return 4;
	return -1;
}

int change_as_mode(const std::string& data)
{
	if (data.compare("oride") == 0) return 1;
	else if (data.compare("share") == 0) return 2;
	else if (data.compare("bcast") == 0) return 3;
	return -1;
}

int change_ni_type(const std::string& data)
{
	if (data.compare("sccp") == 0) return 3;
	else if (data.compare("isup") == 0) return 5;
	return -1;
}

int change_ni(const std::string& str)
{
	if (str.compare("int") == 0) {
		return 0;
	} else if (str.compare("rsv") == 0) {
		return 1;
	} else if (str.compare("nat") == 0) {
		return 2;
	} else if (str.compare("loc") == 0) {
		return 3;
	} 
	return  -1;
}

int change_sp_type(const std::string& str)
{
	if (str.compare("sep") == 0) { return 0; } 
	else if (str.compare("stp") == 0) { return 1; } 
	return -1;
}

int change_mtp3_type(const std::string& str)
{
	if (str.compare("unkown") == 0) { return 0; } 
	else if (str.compare("itu_blue") == 0) { return 1; } 
	else if (str.compare("itu_white") == 0) { return 2; } 
	else if (str.compare("itu_china") == 0) { return 3; } 
	else if (str.compare("ttc") == 0) { return 4; } 
	else if (str.compare("jtt") == 0) { return 5; } 
	else if (str.compare("ansi_88") == 0) { return 17; } 
	else if (str.compare("ansi_91") == 0) { return 18; }
	else if (str.compare("ansi_96") == 0) { return 19; }
	return  -1;
}

std::string change_ni_str(int type)
{
	std::string tmp("null");
	if (type == 0) {
		return tmp.assign("int");
	} else if (type == 1) {
		return tmp.assign("rsv");
	} else if (type == 2) {
		return tmp.assign("nat");
	} else if (type == 3) {
		return tmp.assign("loc");
	}
	return tmp;
}

std::string	change_sptype(int type)
{
	std::string tmp("null");
	if (type == 0) return tmp.assign("sep");
	else if (type == 1) return tmp.assign("stp");
	return tmp;
}

std::string change_variant_str(int type)
{
	std::string tmp("null");
	if (type == 0) return tmp.assign("unkown");
	else if (type == 1) return tmp.assign("itu_blue");
	else if (type == 2) return tmp.assign("itu_white");
	else if (type == 3) return tmp.assign("itu_china");
	else if (type == 4) return tmp.assign("ttc");
	else if (type == 5) return tmp.assign("jtt");
	else if (type == 17) return tmp.assign("ansi_88");
	else if (type == 18) return tmp.assign("ansi_91");
	else if (type == 19) return tmp.assign("ansi_96");
	return  tmp;
}

